/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package cz.muni.fi.pa165.carpark.servicies;

import cz.muni.fi.pa165.carpark.TO.BusinessTripTO;
import cz.muni.fi.pa165.carpark.TO.EmployeeTO;
import cz.muni.fi.pa165.carpark.TO.VehicleTO;
import java.util.Date;
import java.util.List;

/**
 *
 * @author tomas
 */
public interface BusinessTripService {

    /*
     * Creates new BusinesTrip entity in database
     *
     * @param businessTrip BusinessTripDTO to create @throws
     * DataAccessResourceFailureException in case some error od persistence
     * layer.
     */
    void create(BusinessTripTO businessTrip);

    /*
     * Retrieves BusinessTripDTO from database
     *
     * @param id Id of retrieved BusinessTripDTO @return BusinessTripDTO @throws
     * DataRetrievalFailureException in case some error od persistence layer.
     */
    BusinessTripTO retrieve(Long id);

    /*
     * Update entity BusinessTrip in database @param businessTrip
     * BusinessTripDTO to update @throws DataAccessResourceFailureException in
     * case some error od persistence layer.
     */
    void update(BusinessTripTO businessTrip);

    /*
     * Delete BusinessTrip from database @param businessTrip to be deleted
     * @throws DataAccessResourceFailureException in case some error od
     * persistence layer.
     */
    void delete(BusinessTripTO businessTrip);
    
    /*
    * Correct cancel absolved trip, method set the attribute drivenKilomteres in businsessTrip, 
    * --> this add the kilometers to vehicle automatic
    * @param businessTrip to cancel
    * @param drivenKilometers
    */
    void cancelAbsolvedTrip(BusinessTripTO businessTrip,int drivenKilometers);

    /*
     * Return all BusinessTripDTO of given Employee @return
     * List<BusinessTripDTO> List of all employee's businessTrip. @throws
     * DataAccessResourceFailureException in case some error od persistence
     * layer.
     */
    List<BusinessTripTO> retriveEmployeeBusinessTrips(EmployeeTO employee);

    /*
     * Return all BusinessTripDTO of given vehicle. @return
     * List<BusinessTripDTO> List of all vehicle's businessTrip. @throws
     * DataAccessResourceFailureException in case some error od persistence
     * layer.
     */
    List<BusinessTripTO> retrieveVehiclesBusinessTrips(VehicleTO vehicle);

    /*
     * Return all BusinessTripDTO. @return List<BusinessTripDTO> List of all
     * sbusinessTrip. @throws DataAccessResourceFailureException in case some
     * error od persistence layer.
     */
    List<BusinessTripTO> retrieveAll();
    
    
    /**
     * Return trips from collection trips, which are between dates beginDate and endDate
     * @param trips
     * @param beginDate
     * @param endDate
     * @return List<BusinessTripTo> between dates
     */
    List<BusinessTripTO> retrieveByDates(List<BusinessTripTO> trips,Date beginDate,Date endDate);
}
